//将选中的行存入数组，并用isChecked方法在分页时进行选中项重置
     
        function checkedHandler(rowdata)
        {
            if (findUnCheckedArray(rowdata) == -1)
                return false;
            return true;
        }
        
        
        function findUnCheckedArray(rowdata)
        {
        	var uncheckedArray=g.getUncheckedArray();
        	if(uncheckedArray!=null && uncheckedArray!=undefined && uncheckedArray.length>0){
        		for(var i =0;i< uncheckedArray.length;i++)
                {
                	var keyVal;
        			if(g.getKeyId()){
        				keyVal=eval("rowdata."+g.getKeyId().toString());
        			}
        			if(keyVal!=null && keyVal!="" && keyVal!=undefined){
        				if( uncheckedArray[i] == keyVal) return i;
        			}
                }
        	}  
            return -1;
        }
        
        function addUnCheckedArray(rowdata)
        {
        	var keyVal;
			if(g.getKeyId()){
				keyVal=eval("rowdata."+g.getKeyId().toString());
			}
            if(findUnCheckedArray(rowdata) == -1){
            	if(keyVal!=null && keyVal!="" && keyVal!=undefined){
                	g.getUncheckedArray().push(keyVal);      
            	}
            }
            
        }
        function removeUnCheckedArray(rowdata)
        {
            var i = findUnCheckedArray(rowdata);
            if(i==-1) return;
            g.getUncheckedArray().splice(i,1);
        }

        function allSelectRowHandler(obj){
        	var checked=$(obj).is(":checked");
        	if(checked){
        		g.allCountChecked=true;
        	}else{
        		g.options.uncheckedArray=[];
        		g.allCountChecked=false;        		
        	}
        	 for (var rowid in g.records){
                 if(checked){
            		 g.select(g.records[rowid]);
                 }else{
                	 g.unselect(g.records[rowid]);
                 }
             }
        }
